
import requests
import json


#1.使用requests去完成请求接口的任务，并将json结果返回
def yun_login_api(username,paswword):

    url = "http://yun.zenm.vip/iot/account/login/"
    header={
        "Content-Type":"application/json"
    }
    data ={
        "username":username,
        "password":paswword
    }
    json_data = json.dumps(data)

    #使用requests发送请求
    res = requests.post(url=url,data=json_data,headers=header)
    json_data = res.json()

    return json_data